package com.boxing.servlet;

import com.boxing.service.BookService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(urlPatterns = "/book/*")
public class BookServlet extends BaseServlet{
    private BookService bookService = new BookService();

    public void getAllBooks(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        response.getWriter().print(gson.toJson(bookService.searchBooks(request)));
    }
}
